package com.invest.infra.excel.utils.annotation;

import org.apache.commons.collections.CollectionUtils;

import java.util.Collection;

/**
 * Created by evan on 2016/7/13.
 */
public class ExcelColumnAnnotationUtills {

    public static ExcelColumnAnnotation getByIndex(Collection<ExcelColumnAnnotation> list, int index){
        if(CollectionUtils.isEmpty(list) || index < 0 ){
            return null;
        }

        for(ExcelColumnAnnotation annotation : list){
            if(annotation.index() == index){
                return annotation;
            }
        }
        return null;
    }
}
